<template>
  <div v-if="route.path == '/user/login' || route.path == '/user/registry'">
    <router-view />
  </div>
  <div v-else class="home">
    <Header></Header>
    <Main>
      <router-view />
    </Main>
    <Footer></Footer>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import Header from "./components/Header.vue";
import Main from "./components/Main.vue";
import Footer from "./components/Footer.vue";
import { useRoute } from "vue-router";
export default defineComponent({
  components: {
    Header,
    Main,
    Footer,
  },
  setup() {
    const route = useRoute();
    return {
      route,
    };
  },
});
</script>

<style lang="less">
* {
  padding: 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
}
.home {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  header {
    height: 50px;
    background-color: pink;
  }
  main {
    flex: 1;
    overflow: scroll;
    background-color: rgb(231, 236, 181);
  }
  footer {
    height: 50px;
    background-color: pink;
  }
}
</style>
